﻿using com.ruovea.webutil;
using com.ruovea.utilty;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PBKDF2.Key;
using com.ruovea.gogs.entity;
using Newtonsoft.Json.Linq;

namespace GogsWeb.Api.Controllers
{
    /// <summary>
    /// 菜单
    /// </summary>
    public class MenuController : BaseResponse
    {
        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <returns></returns>
        [HttpGet("/api/get_menu_data")]
        public IActionResult GetMenuData()
        {
            object[] onjs = new object[] {
                new { path= "Access",name= "Access",meta=new { icon= "ios-aperture-outline",title= "通道"},component= "gogsview/Access" },
                new { path= "AccessToken",name= "AccessToken",meta=new { icon= "ios-aperture-outline",title= "访问令牌"},component= "gogsview/AccessToken" },
                new { path= "Action",name= "Action",meta=new { icon= "ios-aperture-outline",title= "响应"},component= "gogsview/Action" },
                new { path= "Attachment",name= "Attachment",meta=new { icon= "ios-aperture-outline",title= "附件"},component= "gogsview/Attachment" },
                new { path= "Collaboration",name= "Collaboration",meta=new { icon= "ios-aperture-outline",title= "协作"},component= "gogsview/Collaboration" },
                new { path= "Comment",name= "Comment",meta=new { icon= "ios-aperture-outline",title= "评论"},component= "gogsview/Comment" },
                new { path= "DeployKey",name= "DeployKey",meta=new { icon= "ios-aperture-outline",title= "部署密钥"},component= "gogsview/DeployKey" },
                new { path= "EmailAddress",name= "EmailAddress",meta=new { icon= "ios-aperture-outline",title= "电子邮件地址"},component= "gogsview/EmailAddress" },
                new { path= "Follow",name= "Follow",meta=new { icon= "ios-aperture-outline",title= "顺序"},component= "gogsview/Follow" },
                new { path= "HookTask",name= "HookTask",meta=new { icon= "ios-aperture-outline",title= "钩子任务"},component= "gogsview/HookTask" },
                new { path= "Issue",name= "Issue",meta=new { icon= "ios-aperture-outline",title= "问题"},component= "gogsview/Issue" },
                new { path= "IssueLabel",name= "IssueLabel",meta=new { icon= "ios-aperture-outline",title= "发行标签"},component= "gogsview/IssueLabel" },
                new { path= "IssueUser",name= "IssueUser",meta=new { icon= "ios-aperture-outline",title= "问题用户"},component= "gogsview/IssueUser" },
                new { path= "Label",name= "Label",meta=new { icon= "ios-aperture-outline",title= "标签"},component= "gogsview/Label" },
                new { path= "LfsObject",name= "LfsObject ",meta=new { icon= "ios-aperture-outline",title= "Lfs对象"},component= "gogsview/LfsObject" },
                new { path= "LoginSource",name= "LoginSource",meta=new { icon= "ios-aperture-outline",title= "登录源"},component= "gogsview/LoginSource" },
                new { path= "Milestone",name= "Milestone",meta=new { icon= "ios-aperture-outline",title= "里程碑"},component= "gogsview/Milestone" },
                new { path= "Mirror",name= "Mirror",meta=new { icon= "ios-aperture-outline",title= "镜像"},component= "gogsview/Mirror" },
                new { path= "Notice",name= "Notice",meta=new { icon= "ios-aperture-outline",title= "通知"},component= "gogsview/Notice" },
                new { path= "OrgUser",name= "OrgUser",meta=new { icon= "ios-aperture-outline",title= "组织用户"},component= "gogsview/OrgUser" },
                new { path= "ProtectBranch",name= "ProtectBranch",meta=new { icon= "ios-aperture-outline",title= "保护分支"},component= "gogsview/ProtectBranch" },
                new { path= "ProtectBranchWhitelist",name= "ProtectBranchWhitelist",meta=new { icon= "ios-aperture-outline",title= "保护分支白名单"},component= "gogsview/ProtectBranchWhitelist" },
                new { path= "PublicKey",name= "PublicKey",meta=new { icon= "ios-aperture-outline",title= "公钥"},component= "gogsview/PublicKey" },
                new { path= "PullRequest",name= "PullRequest",meta=new { icon= "ios-aperture-outline",title= "拉取请求"},component= "gogsview/PullRequest" },
                new { path= "Release",name= "Release",meta=new { icon= "ios-aperture-outline",title= "释放"},component= "gogsview/Release" },
                new { path= "Repository",name= "Repository",meta=new { icon= "ios-aperture-outline",title= "存储库"},component= "gogsview/Repository" },
                new { path= "Star",name= "Star",meta=new { icon= "ios-aperture-outline",title= "星号"},component= "gogsview/Star" },
                new { path= "Team",name= "Team",meta=new { icon= "ios-aperture-outline",title= "团队"},component= "gogsview/Team" },
                new { path= "TeamRepo",name= "TeamRepo",meta=new { icon= "ios-aperture-outline",title= "团队回购"},component= "gogsview/TeamRepo" },
                new { path= "TeamUser",name= "TeamUser",meta=new { icon= "ios-aperture-outline",title= "团队用户"},component= "gogsview/TeamUser" },
                new { path= "TwoFactor",name= "TwoFactor",meta=new { icon= "ios-aperture-outline",title= "双因素"},component= "gogsview/TwoFactor" },
                new { path= "TwoFactorRecoveryCode",name= "TwoFactorRecoveryCode",meta=new { icon= "ios-aperture-outline",title= "双因素恢复码"},component= "gogsview/TwoFactorRecoveryCode" },
                new { path= "Upload",name= "Upload",meta=new { icon= "ios-aperture-outline",title= "上载"},component= "gogsview/Upload" },
                //new { path= "User",name= "User",meta=new { icon= "ios-aperture-outline",title= "使用者"},component= "gogsview/User" },
                new { path= "Version",name= "Version",meta=new { icon= "ios-aperture-outline",title= "版本"},component= "gogsview/Version" },
                new { path= "Watch",name= "Watch",meta=new { icon= "ios-aperture-outline",title= "监视"},component= "gogsview/Watch" },
                new { path= "Webhook",name= "Webhook",meta=new { icon= "ios-aperture-outline",title= "钩网"},component= "gogsview/Webhook" },
            };

           var rem= new object[] { new { path = "/gogsserver", name = "gogsserver", meta = new { hideInMenu = false, title = "GoGs服务", icon = "ios-aperture" }, component = "Main", children = onjs } };
            return Success(rem);
        }

    }
}
